<template>
  <div>
    <div class="header">
      <img :src="detailInfo.CoverPhoto" alt="" />
      <span> {{ detailInfo.pic_group_count }} 张照片 </span>
    </div>
    <div class="price">
      <p>
        <span>{{ detailInfo.market_attribute.dealer_price }}</span>
        <span>{{ detailInfo.market_attribute.official_refer_price }}</span>
      </p>
      <router-link tag="button" :to="`/dealer/${detailInfo.list[0].car_id}`"
        >询问底价</router-link
      >
    </div>
  </div>
</template>

<script>
import { getInfoAndListById } from "../api/brand";
export default {
  created() {
    getInfoAndListById({
      SerialID: this.$route.params.id,
    }).then((res) => {
      this.detailInfo = res;
      console.log(res);
    });
  },
  data() {
    return {
      detailInfo: {
          market_attribute: {},
          list: [{}]
      },
    };
  },
};
</script>

<style lang="scss" scoped>
.header {
  height: 500px;
  position: relative;
  img {
    widows: 100%;
    height: 100%;
  }
  span {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: #fff;
    padding: 1px 2px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.6);
    font-size: 24px;
  }
}

.price {
    display: flex;
    
  p {
      display: flex;
      flex-direction: column;
      padding: 20px;
    span:nth-child(1) {
      font-size: 36px;
      color: red;
      font-weight: 500;
    }
    span:nth-child(2) {
      font-size: 26px;
      color: silver;
    }
  }
  button {
    border-radius: 10px;
    font-size: 32px;
    height: 70px;
    width: 345px;
    border: none;
    box-sizing: border-box;
    background: #00afff;
    color: #fff;
    margin-left: 170px;
    margin-top: 25px;
  }
  padding: 36px 2px 3px;
}
</style>